package com.ly.web.controller.erp;

import com.ly.common.annotation.Log;
import com.ly.common.core.domain.AjaxResult;
import com.ly.common.enums.BusinessType;
import com.ly.heart.domain.KingInvoiceFeeSettingEntity;
import com.ly.heart.domain.dto.KingInvoiceFeeSettingDto;
import com.ly.heart.service.IKingInvoiceFeeSettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 发票与费用项目对应设置 前端控制器
 * </p>
 * @author WuZH
 * @since 2024-08-17
 */
@Api (value = "kingInvoiceFeeSetting", tags = "发票与费用项目对应设置")
@RestController
@RequestMapping ("/kingInvoiceFeeSetting")
public class KingInvoiceFeeSettingController {

    @Resource
    private IKingInvoiceFeeSettingService iKingInvoiceFeeSettingService;

    @PreAuthorize ("@ss.hasPermi('heart:kingInvoiceFeeSetting:list')")
    @GetMapping ("/list")
    @ApiOperation ("发票与费用项目对应设置列表")
    public AjaxResult list (KingInvoiceFeeSettingEntity kingInvoiceFeeSettingEntity) {
        List<KingInvoiceFeeSettingEntity> kingInvoiceFeeSettingEntities = iKingInvoiceFeeSettingService.queryList ( kingInvoiceFeeSettingEntity );
        return AjaxResult.success ();
    }

    @PreAuthorize ("@ss.hasPermi('heart:kingInvoiceFeeSetting:query')")
    @GetMapping (value = "/{id}")
    @ApiOperation ("获取发票与费用项目对应设置列表详细信息")
    public AjaxResult getInfo (@PathVariable ("id") String id) {
        return AjaxResult.success ();
    }

    @PreAuthorize ("@ss.hasPermi('heart:kingInvoiceFeeSetting:add')")
    @Log (title = "暂存发票与费用项目对应设置列表", businessType = BusinessType.INSERT)
    @PostMapping ("draft")
    @ApiOperation ("暂存发票与费用项目对应设置列表")
    public AjaxResult draft (@RequestBody KingInvoiceFeeSettingDto kingInvoiceFeeSettingDto) {
        AjaxResult draft = iKingInvoiceFeeSettingService.draft ( kingInvoiceFeeSettingDto );
        return draft;
    }

    @PreAuthorize ("@ss.hasPermi('heart:kingInvoiceFeeSetting:add')")
    @Log (title = "提交发票与费用项目对应设置列表", businessType = BusinessType.INSERT)
    @PostMapping ("submit")
    @ApiOperation ("提交发票与费用项目对应设置列表")
    public AjaxResult submit (@RequestBody KingInvoiceFeeSettingEntity kingInvoiceFeeSettingEntity) {
        AjaxResult submit = iKingInvoiceFeeSettingService.submit ( kingInvoiceFeeSettingEntity );
        return submit;
    }

    @PreAuthorize ("@ss.hasPermi('heart:kingInvoiceFeeSetting:edit')")
    @Log (title = "修改发票与费用项目对应设置列表", businessType = BusinessType.INSERT)
    @PutMapping
    @ApiOperation ("修改发票与费用项目对应设置列表")
    public AjaxResult updateSingle (@RequestBody KingInvoiceFeeSettingDto kingInvoiceFeeSettingDto) {
        AjaxResult submit = iKingInvoiceFeeSettingService.updateSingle ( kingInvoiceFeeSettingDto );
        return submit;
    }

    @PreAuthorize ("@ss.hasPermi('heart:kingInvoiceFeeSetting:remove')")
    @Log (title = "删除发票与费用项目对应设置列表", businessType = BusinessType.INSERT)
    @DeleteMapping ("/{ids}")
    @ApiOperation ("删除发票与费用项目对应设置列表")
    public AjaxResult deleteSingle (@PathVariable String[] ids) {
        AjaxResult submit = iKingInvoiceFeeSettingService.deleteSingle ( ids );
        return submit;
    }

    @PreAuthorize ("@ss.hasPermi('heart:kingInvoiceFeeSetting:remove')")
    @Log (title = "禁用发票与费用项目对应设置列表", businessType = BusinessType.INSERT)
    @RequestMapping ("disabled")
    @ApiOperation ("禁用发票与费用项目对应设置列表")
    public AjaxResult disabled (String id) {
        AjaxResult submit = iKingInvoiceFeeSettingService.disabled ( id );
        return submit;
    }


}
